package Feb_10.Task;

import Feb_10.Task.Task5_1.student;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.List;

public class Task5_2 {
    public static void main(String[] args) {
        File file = new File("e://student.dat");
        try (FileInputStream fileInputStream = new FileInputStream(file);
             ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream))
        {
            List<student> list = (List<student>) objectInputStream.readObject();
            for (student stu:list){
                stu.show();
            }
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
